<?php
include 'config.php';

mysql_select_db("ivalue_accounts");
$result = mysql_query("select * from accounts");

while($matches = mysql_fetch_row($result)) {
    $success = gethostbyname($matches[3]);
    if ($success == $matches[3]) {
	mysql_query("UPDATE `accounts` SET `actualIP` = 'N/A', `acutalIPResolvesTo` = 'N/A', `resolveStatus` = 2 WHERE `id` = '${matches[0]}'");
    } else {
	$actualIPResolvesTo = gethostbyaddr($success);
	mysql_query("UPDATE `accounts` SET `actualIP` = '${success}', `actualIPResolvesTo` = '${actualIPResolvesTo}', `resolveStatus` = 1 WHERE `id` = '${matches[0]}'");
    }
}

mysql_close($dbh);
?>
